<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%request.setAttribute("ctx",request.getContextPath()); %>
<html>
<head>
<link href="${ctx}/extend/css/style.css" rel="stylesheet"
	type="text/css" />
<script src="${ctx}/extend/js/jquery/jquery.js" type="text/javascript"></script>
<script src="${ctx}/extend/js/dutil/DUtil.js" type="text/javascript"></script>
<script src="${ctx}/extend/css/css.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="${ctx}/css/style.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/js/common.js" type="text/javascript"></script>
<s:head theme="xhtml" />
<sx:head parseContent="true" />
<title>invoice query</title>
<script type="text/javascript">
	function addMd(){
	    window.open('${ctx}/admin/toAddMd', "md_add",  "width=1000,height=750,top=6,left=10,scrollbars=auto");
    }
    function viewDetail(mdId) {
    	var road = parseInt(Math.random()*1000000);
    	window.open('${ctx}/admin/viewMd?id='+mdId+'&random='+road, "md_view",  "width=1000,height=750,top=6,left=10,scrollbars=auto");
    }
	function change(all){

		var item = document.getElementsByName("orderVO");
			if(all.checked){
				for(var i=0;i<item.length;i++){
					item[i].checked = true;
				}
			}
			else{
				for(var i=0;i<item.length;i++){
					item[i].checked = false;
				}
			}
	}
	
   function doFresh() {
        if (getFresh()){
        	document.forms[0].submit();
        } 
    }
</script>
</head>
<body class="maintable">
	<div class="dclass_container dclass_container_collapsible">
		<div class="dclass_container_header">
			<div class="dclass_container_title">Lisr Item</div>
		</div>
		<div class="dclass_container_content">
			<div class="search">
				<form action="" method="get">
					<table>
						<tr>
							<td>ItemID:<input type="text" class="inputsearch"
								name="queryId" value="${queryId}" /> &nbsp;&nbsp;&nbsp; Title:<input
								type="text" class="inputsearch" name="title" value="${title}" />
								&nbsp;&nbsp;&nbsp; Ebay Account:<input type="text"
								class="inputsearch" name="ebayAct" value="${ebayAct}" />
								&nbsp;&nbsp;&nbsp; <input type="image"
								src="${ctx}/images/btn_search.gif" align="absbottom" /></td>
						</tr>
					</table>
				</form>
			</div>


		</div>
	</div>
	<br style="line-height: 5px;" />


	<div class="dclass_container">
		<div class="dclass_container_header">
			<div class="dclass_container_title">Item List</div>
		</div>
		<div class="dclass_container_content">
			<!--内容开始-->
			<div class="actions">
				<input type="button" class="btn1" name="viewPic" onclick="addMd();"
					value="Add Item" />&nbsp;
			</div>
			<table class="dclass_data" id="table1" style="display: block">
				<thead>
					<tr>
						<th align="center" width="4%">No.</th>
						<th align="center" width="4%">ItemID</th>
						<th align="center" width="20%">Title</th>
						<th align="center" width="14%">StartPrice</th>
						<th align="center" width="10%">Quantity</th>
						<th align="center" width="15%">Upload status</th>
						<th align="center" width="10%">EbayAccount</th>
					</tr>
				</thead>
				<tbody>
					<c:choose>
						<c:when test="${empty mdList}">
							<tr>
								<td style="background-color: #ffffff" colspan="8">no result</td>
							</tr>
						</c:when>
						<c:otherwise>
							<s:iterator value="mdList" status="status">
								<tr class="list_td" onMouseOver="this.className='list_td0'"
									onMouseOut="this.className='list_td'"
									onDblClick="viewDetail(<s:property value='mdList[#status.index].id'/>)"
									title="double click to view detail">
									<td align="center"><s:property value="#status.index + 1" /></td>
									<td align="center"><s:property
											value="mdList[#status.index].id" /></td>
									<td align="center"><s:property
											value="mdList[#status.index].title" /></td>

									<td align="right"><s:property
											value="mdList[#status.index].startPrice.CurrencyID" />&nbsp;
										<s:property value="mdList[#status.index].startPrice.Value" /></td>

									<td align="right"><s:property
											value="mdList[#status.index].quantity" /></td>

									<td align="center"><s:if
											test="mdList[#status.index].status ==0">stoped</s:if> <s:if
											test="mdList[#status.index].status ==1">uploading</s:if></td>

									<td align="center"><s:property
											value="mdList[#status.index].ebayAccount" /></td>
								</tr>
							</s:iterator>
						</c:otherwise>
					</c:choose>
				</tbody>
			</table>
			<div class="dclass_pager">
				<table width="100%">
					<tr>
						<td width="100%" height="1px" bgcolor="#336699"></td>
					</tr>
					<tr>
						<td width="100%" align="center"><c:choose>
								<c:when test="${empty mdList}">共 0页  第0页   共0条记录</c:when>
								<c:otherwise>
									<c:import url="/admin/common/page3.jsp"></c:import>
								</c:otherwise>
							</c:choose></td>
					</tr>
				</table>
			</div>
			<!--内容结束-->
		</div>
	</div>
</body>
</html>